<?php
/*
 |  ----------------------------------------------------------------------------
 |   Title: Slickpass
 |   Tagline: using the URL
 |   Tags: versioning
 |   Requires: PHP >= 5.3
 |   Description:
 |  ----------------------------------------------------------------------------
 */

/*
 |  ----------------------------------------------------------------------------
 |
 |  ----------------------------------------------------------------------------
 */

/*
 |  ----------------------------------------------------------------------------
 |  Include Config AND Restler
 |  ----------------------------------------------------------------------------
 */
    define("MFTRUE", 1);
    require_once './config.php';
    require_once './vendor/restler.php';

    use Luracast\Restler\Defaults;
    use Luracast\Restler\Restler;
    use Luracast\Restler\RestException;

    Defaults::$useUrlBasedVersioning = true;


/*
 |  ----------------------------------------------------------------------------
 |  Init Restler
 |      Modes:
 |          TRUE  - Prodaction  
 |          FALSE - Debug (default)
 |  ----------------------------------------------------------------------------
 */
    $r = new Restler();
    
    
/*
 |  ----------------------------------------------------------------------------
 |  API Version v1
 |  ----------------------------------------------------------------------------
*/
    $r->setAPIVersion(1);
  
    
/*
 |  ----------------------------------------------------------------------------
 |  Suported response formats
 |  ----------------------------------------------------------------------------
*/
    $r->setSupportedFormats('JsonFormat', 'XmlFormat');
   
    
/*
 |  ----------------------------------------------------------------------------
 |  API Classes
 |  ----------------------------------------------------------------------------
*/
    $r->addAPIClass('Films');
    $r->addAPIClass('CinemaHall');
    $r->addAPIClass('Sessions');
    $r->addAPIClass('Resources');
    $r->handle();